# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=libretro-sameboy
pkgver=1720
pkgrel=2
pkgdesc='Nintendo Game Boy/Game Boy Color core'
arch=(loong64 x86_64)
url=https://github.com/libretro/SameBoy
license=(MIT)
groups=(libretro)
depends=(
  glibc
  libretro-core-info
  libgl
)
makedepends=(
  clang
  git
  libglvnd
  rgbds
  sdl2
)
_commit=68f67b3db7747ba7aac84c5c253bc71d5a906525
source=(libretro-sameboy::git+https://github.com/libretro/SameBoy.git#commit=${_commit})
sha256sums=(SKIP)

pkgver() {
  cd libretro-sameboy
  git rev-list --count HEAD
}

build() {
  export CC=clang
  make -C libretro-sameboy/libretro
}

package() {
  install -Dm 644 libretro-sameboy/libretro/sameboy_libretro.so -t "${pkgdir}"/usr/lib/libretro/
  install -Dm 644 libretro-sameboy/LICENSE -t "${pkgdir}"/usr/share/licenses/libretro-sameboy/
}

# vim: ts=2 sw=2 et:
